package cn.com.enersun.iec61850.web.domain;

import org.openmuc.openiec61850.LogicalDevice;
import org.openmuc.openiec61850.ModelNode;
import org.openmuc.openiec61850.ServerModel;

import java.io.Serializable;
import java.util.List;

/**
 * Created by YYC on 2017/5/4.
 */
public class ServerModelStructure implements Serializable {
    private String id;
    private String devName;
    private String moduleName;
    private String parentReference;
    private Boolean hasChild;
    private String nodeName;
    private String nodeClass;
    private String nodeFc;

    public ServerModelStructure(String devName, String moduleName, String parentReference, Boolean hasChild, String nodeName, String nodeClass, String nodeFc) {
        this.devName = devName;
        this.moduleName = moduleName;
        this.parentReference = parentReference;
        this.hasChild = hasChild;
        this.nodeName = nodeName;
        this.nodeClass = nodeClass;
        this.nodeFc = nodeFc;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDevName() {
        return devName;
    }

    public void setDevName(String devName) {
        this.devName = devName;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public String getParentReference() {
        return parentReference;
    }

    public void setParentReference(String parentReference) {
        this.parentReference = parentReference;
    }

    public Boolean getHasChild() {
        return hasChild;
    }

    public void setHasChild(Boolean hasChild) {
        this.hasChild = hasChild;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public String getNodeClass() {
        return nodeClass;
    }

    public void setNodeClass(String nodeClass) {
        this.nodeClass = nodeClass;
    }

    public String getNodeFc() {
        return nodeFc;
    }

    public void setNodeFc(String nodeFc) {
        this.nodeFc = nodeFc;
    }

    public ServerModel ModelStructuresToSerModel(List<ServerModelStructure> serverModelStructures) {
        //找到根节点
        for(ServerModelStructure serverModelStructure : serverModelStructures){
            if(serverModelStructure.getParentReference() == null) {
            }
        }
        return null;
    }

    public List<ServerModelStructure> SerModelToModelStructures(ServerModel serverModel) {

        return null;
    }

    @Override
    public String toString() {
        return "ServerModelStructure{" +
                "id='" + id + '\'' +
                ", devName='" + devName + '\'' +
                ", moduleName='" + moduleName + '\'' +
                ", parentReference='" + parentReference + '\'' +
                ", hasChild=" + hasChild +
                ", nodeName='" + nodeName + '\'' +
                ", nodeClass='" + nodeClass + '\'' +
                ", nodeFc='" + nodeFc + '\'' +
                '}';
    }
}
